# How to play co-op

Up to 4 players can fly in the same hangar. One player **hosts** (their game is the hangar everyone joins), the others **join** by typing the host's address. Get a build first: see [how-to-play-a-build.md](how-to-play-a-build.md).

The co-op controls are in the **Esc** menu. From the title screen, **Play with friends** opens that menu for you.

## The easy way: Join the station (friends anywhere)

Marz keeps a **station** running on a server all the time. Nobody has to host, and nothing needs installing.

1. Everyone gets the **same, newest build** (a different build is turned away with a message saying which one to get).
2. Open **OhShip.exe** and click **Play with friends** on the title screen. That's it: you join the station.
   (The very first time it asks for your name: type it under **Your name**, then click **Join the station**. In the game, the same button is in the **Esc** menu.)
3. You'll see **"You joined the station."** and start on the pad. Your friends show up as they join. **Leave** (Esc menu) takes you back to flying solo.
5. Anyone can press **Esc → Start a shift** or **End shift**. When everyone leaves, the station starts fresh.

If there's no **Join the station** button, your build doesn't know the station's address (only builds from `main` do, and in those the Esc menu has only the station). The ways below are for those other builds (test builds from a PR), or the **Co-op test** `.bat` files. How the station works and how to set it up: [station-server.md](station-server.md).

## Two copies on one PC (testing alone)

1. Extract the build as usual (see [how-to-play-a-build.md](how-to-play-a-build.md), steps 1–7).
2. In the extracted folder, double-click **Co-op test (two windows).bat**.
3. Two game windows open side by side. The left one (**Left**) hosts, and the right one (**Right**) joins it a couple of seconds later. Both show a green message when they're connected.
4. Click inside a window to fly in it. Only the window you clicked listens to your keys and mouse. The other ship keeps drifting.
5. To switch windows: press **Esc** to free the mouse, then click the other window.
6. To stop: close both windows (or Esc → **Quit** in each).

You can also do it by hand: open the game (**OhShip-build….exe**) twice, then in the first one press Esc → **Host**, and in the second Esc → type `127.0.0.1` in **Host's address** → **Join**.

## With a friend on the same home network (Wi-Fi or cable)

**The host:**
1. Open the game (**OhShip-build….exe**).
2. Press **Esc**. Under **Co-op**, type your name in **Your name**, then click **Host**.
3. The first time, Windows may ask **"Windows Defender Firewall has blocked some features of this app"**. Tick **Private networks**, then click **Allow access**. (Each new build is a new file, so Windows may ask again.)
4. The menu now says **Friends join:** followed by one or more addresses like `192.168.1.23`. Tell your friend that address.
5. Press **Esc** again to close the menu and fly.

**The friend:**
1. Open the game (**OhShip-build….exe**) (the same build as the host).
2. Press **Esc**. Type your name, and type the host's address (e.g. `192.168.1.23`) in **Host's address**.
3. Click **Join**. You'll see "You joined …'s hangar." and start on the pad next to the host's ship.

## With a friend somewhere else (over the internet)

Your router normally blocks a friend's game from reaching yours. Instead of changing router settings, you and your friend both install a free app called **Radmin VPN**, which makes your two PCs act as if they were on the same home network. (Steam will do this for us later, with invites instead of addresses.)

**Once, on both PCs:**
1. Go to **radmin-vpn.com** and click **Download free**.
2. Open the downloaded file and click through the installer (**Next**, accept, **Install**, **Finish**).
3. Radmin VPN opens. If it asks for a computer name, type your name.

**The host:**
1. In Radmin VPN, click **Network** (top left) → **Create network**.
2. Type a network name (e.g. `ohship-marz`) and a password, then click **Create**. Tell your friend both.
3. Open the game (**OhShip-build….exe**), click **Play with friends**, type your name and click **Host**.
4. If Windows asks about the firewall, tick **both Private and Public networks**, then **Allow access**.
5. The menu shows **Over the internet:** with an address like `26.12.34.56 (Radmin VPN)`. Tell your friend that address (just the numbers).

**The friend:**
1. In Radmin VPN, click **Network** → **Join network**, type the host's network name and password, then **Join**. The host's PC appears in the list with a green dot.
2. Open the game (**OhShip-build….exe**) (the same build as the host), click **Play with friends**, type your name.
3. Type the host's `26.…` address in **Host's address** and click **Join**.

You can also use **Tailscale** (tailscale.com) or **ZeroTier** the same way: both PCs join the same network, and the friend joins the address the host's app shows (Tailscale's start with `100.`). When you're done playing, you can close Radmin VPN from the system tray.

## What you'll see

- Your friend's ship, with their name floating above it in their colour. Walls hide the name, so you need to look (or ask) to find them.
- Each player gets their own bay. Your friend's bay sign shows their name in their colour, and the host never gives two players the same bay.
- Ships are solid. Ramming your friend counts as a bump for both of you, and a heavy ship shoves a light one harder.
- **Esc doesn't pause in co-op**, because the hangar keeps going for your friend. Your ship keeps drifting while the menu is open, and your keys don't fly it.
- **Leave** (in the Esc menu) takes you back to flying solo. If the host leaves, everyone else goes back to solo with a message.

## If something goes wrong

| What you see | What to do |
|---|---|
| "Couldn't reach … Is your friend hosting?" | Check the host clicked **Host**, the address is typed right, and you're on the same network (or both in the same Radmin VPN network, green dot). Check the host allowed the game through the firewall (step 3 above; over the internet tick both boxes). If it still fails, the host can open **Windows Security → Firewall & network protection → Allow an app through firewall** and tick both boxes next to OhShip. |
| "Couldn't host on port 7777" | Another copy of the game is already hosting on this PC. Close it, or join it instead. |
| "That hangar runs a different build of Oh Ship." | Both players need the same build. Check the build number in the bottom-right corner. |
| "That hangar is full." | 4 players is the most for now. |

The window title shows who you are (e.g. "Oh Ship - Left (host)"), which helps with two windows on one PC.
